<!DOCTYPE html>
<html>
<head>
<title>信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">
<script type="text/javascript">
	var dataGrid;
	var winWidth =  420;
	var winHeight = 400;
	var editTitle = "查看信息内容";
	var editUrl =  "/modules/system/message/contentPage.html";
	$(function() {
		var editIndex = undefined;
		dataGrid = $('#dataGrid').datagrid({
			url : 'list.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'asc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [ [ 		
			{ field: 'id', title: '编号', width: 50, checkbox : false},
			{ field: 'type', title: '类型', width: 50, sortable:false,
				formatter:function(value, row, index){
					if(value=="1"){
						return "短信";
					}else if(value=="2"){
						return "邮件";
					}else if(value=="3"){
						return "站内信";
					}else{
						return "";
					}
				}
			},
			{ field: 'sentName', title: '发送者', width: 80, sortable : false},
			{ field: 'receiveName', title: '接收者', width: 80, sortable : false},
			{ field: 'receiveAddr', title: '接收地址', width: 100, sortable : false},
			{ field: 'status', title: '发送状态', width: 60, sortable:false,
				formatter:function(value, row, index){
					if(value=="1"){
						return "成功";
					}else if(value=="2"){
						return "失败";
					}else{
						return "";
					}
				}
			},
			{ field: 'title', title: '标题', width: 100, sortable : false},
			{ field: 'addTime', title: '发送时间', width: 150,
				formatter: function(value,row,index){
					if (value){
						return getLocalTime(value,4);
					} else {
						return "";
					}
				}
			},
			{ field : 'showInfo',
                title : '其他信息',
                width :75,
                align:'center',
                fixed:true,
                formatter : function(value, row, index) {
					var content = '<a href="javascript:void(0);" class="j-showInfo">查看<i class="iconfont">&#xe639;</i></a>'
						+ '<div class="showInfoSingleDiv">'
						+ '<div class="showInfo">'
						+ '<em></em><h2>消息记录</h2>'
						+ '<ul>'
						+ '<li>'
                		+ '<span>发送结果：</span>'
						+ row.result
						+ '</li>'
						+ '<li>'
                		+ '<span>消息内容：</span>'
						+ row.content
						+ '</li>'
						+ '</ul></div></div>';
				return content;
				}
			},
			] ],
			toolbar : '#toolbar'
		});
	});
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
			<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder=" 输入接收者用户名/标题进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
	            	<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
		        	<li><span>标题</span><input type="text" name="title" autocomplete="off"/></li>
		        	<li>
		        		<span>类型</span>
		        		<select name="type" class="type">
							<option value="99" selected="selected">全部</option>
							<option value="1">短信</option>
							<option value="2">邮件</option>
							<option value="3">站内信</option>
						</select>
					</li>
		        	<li>
		        		<span>发送状态</span>
		        		<select name="status" class="type">
							<option value="99" selected="selected">全部</option>
							<option value="1">发送成功</option>
							<option value="2">发送失败</option>
						</select>
					</li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>